package d0324;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TestReg {
    public static void main(String[] args) {
       /* String regex ="^((13[0-9])|(15[^4,\\\\D])|(18[0,5-9]))\\\\d{8}$";
         Pattern pattern= Pattern.compile(regex)  ;
        String phoneNum="13756812952";
        Matcher matcher=pattern.matcher(phoneNum);
        if (matcher.matches()) {
            System.out.println("正确");
        }else{
                System.out.println("失败");
            }
        }
    } */
      /*  String phoneNum = "13756812952";
        String regex = "^((13[0-9])|(15[^4,\\\\D])|(18[0,5-9]))\\\\d{8}$";
        boolean result = Pattern.matches(regex, phoneNum);
        if (result) {
            System.out.println("正确");
        } else {
            System.out.println("失败");
        }

    }
} */
        String phoneNum = "13756812952";
        String regex = "^((13[0-9])|(15[^4,\\\\D])|(18[0,5-9]))\\\\d{8}$";
        boolean result = phoneNum.matches(regex);
        if (result) {
            System.out.println("正确");
        } else {
            System.out.println("失败");
        }
    }
}